<% @new_tasks.each do |task| %>
  jQuery('#events_table').prepend('<%=j render(partial: 'queue_dispatcher_views/task_event', locals: {task: task, show_ids:  defined?(show_ids) ? show_ids : false, id_prefix: defined?(id_prefix) ? id_prefix : '' }) %>');
  jQuery('#task_<%= task.id %>').effect('highlight');
<% end %>

<% @updated_tasks.each do |task| %>
  jQuery('#task_<%= task.id %>').replaceWith('<%=j render(partial: 'queue_dispatcher_views/task_event', locals: {task: task, show_ids:  defined?(show_ids) ? show_ids :    false, id_prefix: defined?(id_prefix) ? id_prefix : '' }) %>');
  jQuery('#task_<%= task.id %>').effect('highlight');
<% end %>

<% @deleted_task_ids.each do |id| %>
  jQuery('#task_<%= id %>').fadeOut();
<% end %>

<%= update_flash %>
